package jfuzzyprincepless.agents;

import java.util.List;
import java.util.ArrayList;

import jfuzzyprincepless.negotiation.INegotiationContext;
import jfuzzyprincepless.negotiation.services.IService;
import laboratoryQ.computation.BaseUtils;

/**
 * utility class, only registers services
 */
public class RegisterServicesAgent
	extends BaseNegotiationAgent
{
	private List<IService> services =
		new ArrayList<IService>();

	public RegisterServicesAgent(IService ... services) {
		BaseUtils.addAll(this.services, services);
	}

	@Override
	public void onNegotiationStart(
		INegotiationContext context
	) {
		for (IService service : services) {
			context.registerService(service);
		}
	}

	public List<IService> getServices() {
		return services;
	}
}
